class amojaSwiperBase extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{carousel:`.${elementorFrontend.config.swiperClass}`,slideContent:".swiper-slide"}}}getDefaultElements(){var e=this.getSettings("selectors");const t={$swiperContainer:this.$element.find(e.carousel)};return t.$slides=t.$swiperContainer.find(e.slideContent),t}getSwiperSettings(){const s=this.getElementSettings(),e=s.slides_to_show||3,t=1===e,i=elementorFrontend.config.responsive.activeBreakpoints,n={mobile:1,tablet:t?1:2},a={slidesPerView:e,loop:"yes"===s.infinite,speed:s.speed,handleElementorBreakpoints:!0,watchSlidesVisibility:!0,breakpoints:{}};let r=e,o=0;s.spaceBetween&&(a.spaceBetween=s.spaceBetween.size,o=s.spaceBetween.size||0),Object.keys(i).reverse().forEach(e=>{var t=n[e]||r;a.breakpoints[i[e].value]={slidesPerView:+s["slides_to_show_"+e]||t,slidesPerGroup:+s["slides_to_scroll_"+e]||1},r=+s["slides_to_show_"+e]||t,void 0!==s["spaceBetween_"+e]&&(a.breakpoints[i[e].value].spaceBetween=+s["spaceBetween_"+e].size||o,o=+s["spaceBetween_"+e].size||0)}),"yes"===s.autoplay&&(a.autoplay={delay:s.autoplay_speed,disableOnInteraction:"yes"===s.pause_on_interaction}),"yes"===s.mousewheel&&(a.mousewheel=!0),"yes"===s.autoheight?a.autoHeight=!0:a.autoHeight=!1,"yes"===s.lazyload&&(a.lazy=!0),"yes"===s.enable_centeredSlides&&(a.centeredSlides=!0),t?(a.effect=s.effect,"fade"===s.effect&&(a.fadeEffect={crossFade:!0})):"fade"===s.effect?(a.effect="fade",a.fadeEffect={crossFade:!0}):a.slidesPerGroup=+s.slides_to_scroll||1;var l="arrows"===s.navigation||"both"===s.navigation,p="dots"===s.navigation||"both"===s.navigation||"custom"===s.navigation;return l&&(a.navigation={prevEl:this.$element.find(".elementor-swiper-button-prev").get(0),nextEl:this.$element.find(".elementor-swiper-button-next").get(0)}),p&&(a.pagination={el:this.$element.find(".swiper-pagination").get(0),type:"bullets",clickable:!0}),void 0!==s.enable_scrollbar&&"yes"===s.enable_scrollbar&&(a.scrollbar={el:this.$element.find(".swiper-scrollbar").get(0),hide:!1,draggable:!0},a.loop=!1),void 0!==s.enable_fraction&&"yes"===s.enable_fraction&&(a.pagination={el:this.$element.find(".swiper-pagination").get(0),type:"fraction",formatFractionCurrent:function(e){return("0"+e).slice(-2)},formatFractionTotal:function(e){return("0"+e).slice(-2)},renderFraction:function(e,t){return' '}},a.loop=!0),"vertical"===s.direction&&(a.direction="vertical",a.slidesPerView=1,a.breakpoints={},a.loop=!1,a.on={init:function(e){var t=e.slides[e.activeIndex].children[0];jQuery(e.$el).css({height:t.clientHeight})},slideChange:function(e){var t=e.slides[e.activeIndex].children[0];jQuery(e.$el).css({height:t.clientHeight})}}),a}updateSwiperOption(e){const t=this.getElementSettings(),s=t[e],i=this.swiper.params;switch(e){case"image_spacing_custom":i.spaceBetween=s.size||0;break;case"autoplay_speed":i.autoplay.delay=s;break;case"speed":i.speed=s}this.swiper.update()}getChangeableProperties(){return{pause_on_hover:"pauseOnHover",autoplay_speed:"delay",speed:"speed",image_spacing_custom:"spaceBetween"}}onElementChange(e){var t;this.getChangeableProperties()[e]&&("pause_on_hover"===e?(t=this.getElementSettings("pause_on_hover"),this.togglePauseOnHover("yes"===t)):this.updateSwiperOption(e))}onEditSettingsChange(e){"activeItemIndex"===e&&this.swiper.slideToLoop(this.getEditSettings("activeItemIndex")-1)}async bindEvents(){var e=this.getElementSettings();if(this.elements.$swiperContainer.length&&!(this.elements.$slides.length<2)){const t=elementorFrontend.utils.swiper;this.swiper=await new t(this.elements.$swiperContainer,this.getSwiperSettings()),this.elements.$swiperContainer.data("swiper",this.swiper),"yes"===e.pause_on_hover&&this.togglePauseOnHover(!0),this.animate()}}animate(){var e=this.swiper.$wrapperEl.find(".swiper-slide");jQuery(e).filter(".swiper-slide-active").addClass("animated"),this.swiper.on("slideChange",()=>{this.swiper.$wrapperEl.find(".elementor-widget-amoja-image-lookbook").trigger("slideChange")}),this.swiper.on("slideChangeTransitionEnd",()=>{var e=this.swiper.$wrapperEl.find(".swiper-slide"),t=jQuery(e).filter(".swiper-slide-active");t.addClass("animated"),e.removeClass("swiper-ken-burn-active"),t.addClass("swiper-ken-burn-active")}),this.swiper.on("slideChangeTransitionStart",()=>{this.swiper.$wrapperEl.find(".swiper-slide").removeClass("animated")})}togglePauseOnHover(e){e?this.elements.$swiperContainer.on({mouseenter:()=>{this.swiper.autoplay.stop()},mouseleave:()=>{this.swiper.autoplay.start()}}):this.elements.$swiperContainer.off("mouseenter mouseleave")}}